home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xdlibs / signal.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-18  |  2.9 KB  |  92 lines

  1. /* 
  2.  * @(#)signal.h, XdLibs - SozobonX
  3.  * last change
  4.  *  -jerry: 1995/03/20
  5.  */
  6.  
  7. #ifndef _SIGNAL_H
  8. #define _SIGNAL_H
  9.  
  10.  
  11. #define    NSIG        31        /* number of signals recognized */
  12.  
  13. #define    SIGNULL        0        /* not really a signal */
  14. #define SIGHUP        1        /* hangup signal */
  15. #define SIGINT        2        /* sent by ^C */
  16. #define SIGQUIT        3        /* quit signal */
  17. #define SIGILL        4        /* illegal instruction */
  18. #define SIGTRAP        5        /* trace trap */
  19. #define SIGABRT        6        /* abort signal */
  20. #define SIGPRIV        7        /* privilege violation */
  21. #define SIGFPE        8        /* divide by zero */
  22. #define SIGKILL        9        /* cannot be ignored */
  23. #define SIGBUS        10        /* bus error */
  24. #define SIGSEGV        11        /* illegal memory reference */
  25. #define SIGSYS        12        /* bad argument to a system call */
  26. #define SIGPIPE        13        /* broken pipe */
  27. #define SIGALRM        14        /* alarm clock */
  28. #define SIGTERM        15        /* software termination signal */
  29.  
  30. #define SIGURG        16        /* urgent condition on I/O channel */
  31. #define SIGSTOP        17        /* stop signal not from terminal */
  32. #define SIGTSTP        18        /* stop signal from terminal */
  33. #define SIGCONT        19        /* continue stopped process */
  34. #define SIGCHLD        20        /* child stopped or exited */
  35. #define SIGTTIN        21        /* read by background process */
  36. #define SIGTTOU        22        /* write by background process */
  37. #define SIGIO        23        /* I/O possible on a descriptor */
  38. #define SIGXCPU        24        /* CPU time exhausted */
  39. #define SIGXFSZ        25        /* file size limited exceeded */
  40. #define SIGVTALRM    26        /* virtual timer alarm */
  41. #define SIGPROF        27        /* profiling timer expired */
  42. #define SIGWINCH    28        /* window size changed */
  43. #define SIGUSR1        29        /* user signal 1 */
  44. #define SIGUSR2        30        /* user signal 2 */
  45.  
  46.  
  47. typedef void (*_Sigfunc)(long signum);
  48.  
  49. #define       SIG_DFL    ((_Sigfunc)0L)
  50. #define       SIG_IGN    ((_Sigfunc)1L)
  51. #define       SIG_ERR    ((_Sigfunc)-1L)
  52.  
  53.  
  54. /* sigaction: extended POSIX signal handling facility */
  55.  
  56. struct sigaction {
  57.     _Sigfunc sa_handler;    /* pointer to signal handler */
  58.     unsigned long    sa_mask;    /* additional signals masked during delivery */
  59.     unsigned short    sa_flags;    /* signal specific flags */
  60.     /* signal flags */
  61. #define SA_NOCLDSTOP    1    /* don't send SIGCHLD when child stops */
  62. };
  63.  
  64. #ifdef __MSHORT__
  65.  
  66. extern long gemdos();
  67.  
  68. #define signal(sig, handler) \
  69.                 (_Sigfunc)gemdos(0x112, (short)sig, (long)handler)
  70. #define    sigblock(mask)        \
  71.                 gemdos(0x116, (unsigned long)(mask))
  72. #define    sigsetmask(mask)    \
  73.                 gemdos(0x117, (unsigned long)(mask))
  74. #define    sigpending()             gemdos(0x123)
  75. #define    sigreturn()             gemdos(0x11a)
  76. #define    sigaction(sig, act, oact) \
  77.         gemdos(0x137, (short)(sig), (long)(act), (long)(oact))
  78. #else
  79.  
  80. #include <osbind.h>
  81. #define    signal(sig, handler)    (_Sigfunc)Psignal((sig), (handler))
  82. #define    sigblock(mask)        Psigblock(mask)
  83. #define    sigsetmask(mask)    Psigsetmask(mask)
  84. #define    sigpending()        Psigpending()
  85. #define    sigreturn()        Psigreturn()
  86. #define    sigaction(sig, act, oact) \
  87.                 Psigaction((sig), (act), (oact))
  88. #endif /* __MSHORT__ */
  89.  
  90. #endif /* _SIGNAL_H */
  91.  
  92.